
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>2.3 SessionPool · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../3pa-chong-kong-zhi.html" />
    
    
    <link rel="prev" href="22-pipline.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    序言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1.html">
            
                <a href="../chapter1.html">
            
                    
                    1. 快速入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../2ji-ben-zu-jian.html">
            
                <a href="../2ji-ben-zu-jian.html">
            
                    
                    2.基本组件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="processor.html">
            
                <a href="processor.html">
            
                    
                    2.1 Processor
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="22-pipline.html">
            
                <a href="22-pipline.html">
            
                    
                    2.2 Pipline
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3.3" data-path="23-sessionpool.html">
            
                <a href="23-sessionpool.html">
            
                    
                    2.3 SessionPool
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../3pa-chong-kong-zhi.html">
            
                <a href="../3pa-chong-kong-zhi.html">
            
                    
                    3.爬虫控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../4chou-qu-qi.html">
            
                <a href="../4chou-qu-qi.html">
            
                    
                    4.抽取器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../4chou-qu-qi/41sipsoup.html">
            
                <a href="../4chou-qu-qi/41sipsoup.html">
            
                    
                    4.1SipSoup
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../4chou-qu-qi/42tableevaluator.html">
            
                <a href="../4chou-qu-qi/42tableevaluator.html">
            
                    
                    4.2TableEvaluator
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../5zhong-zi-guan-li-qi.html">
            
                <a href="../5zhong-zi-guan-li-qi.html">
            
                    
                    5.种子管理器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../6shi-jian-xun-huan.html">
            
                <a href="../6shi-jian-xun-huan.html">
            
                    
                    6.事件循环
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../6shi-jian-xun-huan/61-eventloopgong-zuo-ji-zhi.html">
            
                <a href="../6shi-jian-xun-huan/61-eventloopgong-zuo-ji-zhi.html">
            
                    
                    6.1 eventLoop工作机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../6shi-jian-xun-huan/62zi-dong-shi-jian.html">
            
                <a href="../6shi-jian-xun-huan/62zi-dong-shi-jian.html">
            
                    
                    6.2 自动事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../6shi-jian-xun-huan/63delayevent.html">
            
                <a href="../6shi-jian-xun-huan/63delayevent.html">
            
                    
                    6.3 延时事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../6shi-jian-xun-huan/64classScanner.html">
            
                <a href="../6shi-jian-xun-huan/64classScanner.html">
            
                    
                    6.4 classScanner
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >2.3 SessionPool</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x672C;&#x6765;&#x6211;&#x89C9;&#x5F97;&#x8FD9;&#x4E2A;&#x7EC4;&#x4EF6;&#x5E94;&#x8BE5;&#x53EB;&#x505A;session&#xFF0C;&#x4F46;&#x662F;Processor&#x7AE0;&#x8282;&#x4ECB;&#x7ECD;&#x8FC7;CrawlerSession&#xFF0C;&#x6240;&#x4EE5;&#x5C31;&#x8BB2;&#x8BB2;SessionPool&#x5427;&#x3002;&#x987E;&#x540D;&#x601D;&#x4E49;&#xFF0C;SessionPool&#x5C31;&#x662F;&#x4E00;&#x4E2A;session&#x8D44;&#x6E90;&#x6C60;&#xFF0C;&#x6240;&#x4EE5;sessionPool&#x672C;&#x8EAB;&#x6CA1;&#x6709;&#x7528;&#x6237;&#x53EF;&#x5B9A;&#x5236;&#x7684;&#x5730;&#x65B9;&#x7684;&#x3002;&#x4F46;&#x662F;&#x5979;&#x6709;&#x8BB8;&#x591A;&#x7684;&#x53C2;&#x6570;&#xFF1A;</p>
<pre><code class="lang-java">                .setSessionPoolCoreSize(<span class="hljs-number">15</span>)<span class="hljs-comment">// &#x6838;&#x5FC3;15&#x4E2A;&#x7528;&#x6237;</span>
                .setSessionPoolMaxSize(<span class="hljs-number">55</span>)<span class="hljs-comment">// &#x6700;&#x591A;55&#x4E2A;&#x7528;&#x6237;</span>
                .setSessionPoolReuseDuration(<span class="hljs-number">60</span> * <span class="hljs-number">1000</span>)<span class="hljs-comment">// &#x6BCF;&#x4E2A;&#x7528;&#x6237;1&#x5206;&#x949F;&#x4E4B;&#x5185;&#x4E0D;&#x80FD;&#x540C;&#x65F6;&#x4F7F;&#x7528;</span>
                .setSessionPoolMaxOnlineDuration(<span class="hljs-number">10</span> * <span class="hljs-number">60</span> * <span class="hljs-number">1000</span>)<span class="hljs-comment">// &#x6BCF;&#x4E2A;&#x7528;&#x6237;&#x6700;&#x591A;&#x5B58;&#x6D3B;10&#x5206;&#x949F;</span>
</code></pre>
<p>&#x8FD9;&#x4E9B;&#x5C31;&#x662F;session&#x51E0;&#x4E2A;&#x6838;&#x5FC3;&#x63A7;&#x5236;&#x70B9;&#xFF0C;&#x7528;&#x6765;&#x786E;&#x5B9A;&#x5E76;&#x53D1;&#x6570;&#x91CF;&#xFF0C;sessionPool&#x662F;VS&#x53EF;&#x4EE5;&#x5B8C;&#x7F8E;&#x652F;&#x6301;&#x591A;&#x7528;&#x6237;&#x5E76;&#x53D1;&#x767B;&#x5F55;&#x6293;&#x53D6;&#x7684;&#x6839;&#x672C;</p>
<p>&#x548C;seesion&#x76F8;&#x5173;&#x7684;&#x5176;&#x4ED6;&#x77E5;&#x8BC6;&#x8FD8;&#x6709;</p>
<h2 id="crawlerhttpclientgenerator">CrawlerHttpClientGenerator</h2>
<p>&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x6269;&#x5C55;&#x70B9;&#xFF0C;&#x7528;&#x6765;&#x5B9A;&#x5236;&#x4F60;&#x7684;httpclient&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4ED6;&#x6765;&#x8BBE;&#x7F6E;&#x4F60;&#x7684;httpclient&#x7684;&#x4EFB;&#x4F55;&#x53C2;&#x6570;&#xFF0C;&#x56E0;&#x4E3A;&#x8FD9;&#x4E2A;&#x63A5;&#x53E3;&#x7ED9;&#x4F60;&#x4F20;&#x9012;&#x7684;&#x53C2;&#x6570;&#x5C31;&#x662F;&#x4E00;&#x4E2A;httpclientBuilder</p>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">interface</span> <span class="hljs-title">CrawlerHttpClientGenerator</span> </span>{
    <span class="hljs-comment">/**
     * &#x6784;&#x5EFA;&#x4E00;&#x4E2A;httpclient,&#x8BF7;&#x6CE8;&#x610F;&#x5FC5;&#x987B;&#x4F7F;&#x7528;ProxyFeedBackDecorateHttpClientBuilder&#x6784;&#x9020;httpclient,&#x5426;&#x5219;&#x4EE3;&#x7406;&#x81EA;&#x52A8;&#x6253;&#x5206;&#x529F;&#x80FD;&#x4E0D;&#x4F1A;&#x751F;&#x6548;
     * ProxyFeedBackDecorateHttpClientBuilder&#x4EA7;&#x751F;&#x7684;httpclient&#x4F1A;&#x81EA;&#x52A8;&#x62E6;&#x622A;&#x8BF7;&#x6C42;&#x52A8;&#x4F5C;,&#x5E76;&#x6839;&#x636E;&#x5F02;&#x5E38;&#x60C5;&#x51B5;&#x5BF9;IP&#x8FDB;&#x884C;&#x6253;&#x5206;
     *
     * <span class="hljs-doctag">@param</span> crawlerHttpClientBuilder httpclient&#x6784;&#x5EFA;&#x5668;
     * <span class="hljs-doctag">@return</span> &#x9002;&#x5408;&#x722C;&#x866B;&#x7684;httpclient&#x5BF9;&#x8C61;
     */</span>
    <span class="hljs-function">CrawlerHttpClient <span class="hljs-title">gen</span><span class="hljs-params">(CrawlerHttpClientBuilder crawlerHttpClientBuilder)</span></span>;
} 
</code></pre>
<p>&#x7136;&#x540E;&#x4F60;&#x53EF;&#x80FD;&#x8981;&#x95EE;&#x4E86;&#xFF0C;&#x6211;&#x81EA;&#x5DF1;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;HttpClientBuilder&#x4E0D;&#x884C;&#x4E48;&#x3002;&#x7B54;&#x6848;&#x662F;&#x4E0D;&#x884C;&#xFF0C;&#x56E0;&#x4E3A;VS&#x5BF9;&#x8FD9;&#x4E2A;HttpClientBuilder&#x505A;&#x4E86;&#x5B9A;&#x5236;&#xFF0C;&#x4E3A;&#x4E86;&#x81EA;&#x52A8;&#x7684;&#x5B9E;&#x73B0;&#x4EE3;&#x7406;IP&#x4F7F;&#x7528;&#x8BC4;&#x5206;&#x3002;</p>
<h2 id="autologinplugin">autoLoginPlugin</h2>
<p>&#x4F60;&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x6240;&#x6709;session&#x5728;&#x521B;&#x5EFA;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x8FDB;&#x884C;&#x767B;&#x5F55;&#xFF0C;&#x5982;&#x679C;&#x767B;&#x5F55;&#x4E0D;&#x6210;&#x529F;&#xFF0C;&#x5219;&#x6807;&#x8BB0;&#x8BE5;session&#x65E0;&#x6548;&#x3002;&#x8FD9;&#x4E2A;&#x529F;&#x80FD;&#x5728;VS&#x4E2D;&#x662F;&#x4EE5;&#x63D2;&#x4EF6;&#x7684;&#x5F62;&#x5F0F;&#x5B9E;&#x73B0;&#x7684;&#x3002;&#x4E3A;&#x5565;&#x8981;&#x505A;&#x6210;&#x63D2;&#x4EF6;&#xFF0C;&#x4EE5;&#x53CA;&#x5982;&#x4F55;&#x4E3A;VS&#x5199;&#x63D2;&#x4EF6;&#x3002;&#x8BF7;&#x540E;&#x7EED;&#x53C2;&#x89C1;VS&#x4E8B;&#x4EF6;&#x5FAA;&#x73AF;&#x76F8;&#x5173;&#x6587;&#x6863;&#x3002;</p>
<p>&#x5982;&#x679C;&#x8981;&#x767B;&#x5F55;&#xFF0C;&#x90A3;&#x4E48;&#x95EE;&#x9898;&#x6765;&#x4E86;&#xFF0C;VS&#x600E;&#x4E48;&#x77E5;&#x9053;&#x5982;&#x4F55;&#x767B;&#x5F55;&#xFF0C;&#x8D26;&#x53F7;&#x5BC6;&#x7801;&#x53C8;&#x662F;&#x5565;&#x3002;&#x6240;&#x4EE5;&#x8FD9;&#x91CC;&#x5F15;&#x51FA;&#x4E24;&#x4E2A;&#x63A5;&#x53E3;&#x5206;&#x522B;&#x662F;&#xFF1A;LoginHandler&#xFF0C;UserResourceFacade&#x3002;&#x5176;&#x4E2D;LoginHandler&#x91CC;&#x9762;&#x53EF;&#x4EE5;&#x4E66;&#x5199;&#x767B;&#x5F55;&#x903B;&#x8F91;&#xFF0C;UserResourceFacade&#x5219;&#x8D1F;&#x8D23;&#x5012;&#x5165;&#x7528;&#x6237;&#x8D26;&#x6237;&#x4FE1;&#x606F;</p>
<p>LoginHandler&#x7B7E;&#x540D;&#x5982;&#x4E0B;</p>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">interface</span> <span class="hljs-title">LoginHandler</span> </span>{
    <span class="hljs-comment">/**
     * &#x767B;&#x5F55;
     * 
     * <span class="hljs-doctag">@param</span> user &#x8D26;&#x6237;&#x4FE1;&#x606F;
     * <span class="hljs-doctag">@param</span> cookieStore &#x5BF9;&#x5E94;cookieStore,&#x767B;&#x5F55;&#x6210;&#x529F;&#x540E;&#x9700;&#x8981;&#x628A;cookie&#x5199;&#x5230;cookieStore
     * <span class="hljs-doctag">@param</span> crawlerHttpClient &#x8FD9;&#x4E2A;httpclient&#x6301;&#x6709;cookieStore,&#x53EF;&#x4EE5;&#x7528;&#x5B83;&#x65B9;&#x4FBF;&#x7684;&#x767B;&#x5F55;
     * <span class="hljs-doctag">@return</span> &#x662F;&#x5426;&#x767B;&#x5F55;
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">boolean</span> <span class="hljs-title">onLogin</span><span class="hljs-params">(User user, CookieStore cookieStore, CrawlerHttpClient crawlerHttpClient)</span></span>;

    <span class="hljs-comment">/**
     * &#x5982;&#x679C;&#x957F;&#x65F6;&#x95F4;&#x6CA1;&#x6709;&#x6293;&#x53D6;,&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;&#x5F53;&#x524D;&#x8D26;&#x6237;&#x65F6;&#x5019;&#x4ECD;&#x7136;&#x5904;&#x4E8E;&#x767B;&#x5F55;&#x72B6;&#x6001;
     * 
     * <span class="hljs-doctag">@param</span> cookieStore
     * <span class="hljs-doctag">@param</span> crawlerHttpClient
     * <span class="hljs-doctag">@return</span>
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">boolean</span> <span class="hljs-title">testLogin</span><span class="hljs-params">(CookieStore cookieStore, CrawlerHttpClient crawlerHttpClient)</span></span>;

    <span class="hljs-comment">// TODO</span>
    <span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">logout</span><span class="hljs-params">(User user, CookieStore cookieStore, CrawlerHttpClient crawlerHttpClient)</span></span>;
}
</code></pre>
<p>UserResourceFacade&#x7B7E;&#x540D;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>public interface UserResourceFacade {
    Collection&lt;User&gt; importUser();
}
</code></pre><p>&#x5176;&#x4E2D;VS&#x6709;&#x4E00;&#x4E2A;&#x9ED8;&#x8BA4;&#x7684;&#x7528;&#x6237;&#x5012;&#x5165;&#x5B9E;&#x73B0;&#xFF0C;&#x53EB;&#x505A;DefaultUserResource&#xFF0C;&#x9ED8;&#x8BA4;&#x6709;&#x4E24;&#x79CD;&#x7B56;&#x7565; 1.&#x5982;&#x679C;vsCrawler&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x914D;&#x7F6E;&#x4E86;&#x7528;&#x6237;&#x6570;&#x636E;,&#x90A3;&#x4E48;&#x52A0;&#x8F7D;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x7528;&#x6237;&#x6570;&#x636E;,&#x4E14;&#x4F1A;&#x5B9E;&#x65F6;load&#x65B0;&#x589E;&#x7528;&#x6237;&#x6570;&#x636E;&#xFF1B;2.&#x5982;&#x679C;vsCrawler&#x4E2D;&#x6CA1;&#x6709;&#x914D;&#x7F6E;&#x7528;&#x6237;&#x6570;&#x636E;,&#x90A3;&#x4E48;mock&#x7528;&#x6237;&#x6570;&#x636E;,&#x4EA7;&#x751F;&#x7528;&#x6237;&#x540D;&#x5BC6;&#x7801;&#x5747;&#x4E3A;&#x7A7A;&#x7684;&#x8D26;&#x6237;&#x4FE1;&#x606F;&#x3002;&#x4F60;&#x53EA;&#x9700;&#x8981;&#x5728;&#x722C;&#x866B;&#x63A7;&#x5236;&#x6587;&#x4EF6;&#x4E2D;&#x6DFB;&#x52A0;&#x5E10;&#x6237;&#x76F8;&#x5173;&#x914D;&#x7F6E;,&#x5C31;&#x4F1A;&#x81EA;&#x52A8;&#x5BFC;&#x5165;&#x8D26;&#x53F7;&#x6570;&#x636E;&#x5230;VS&#x4E2D;</p>
<pre><code>userResource.userInfo=account,password;acount2,password2
</code></pre><h2 id="&#x968F;&#x65F6;&#x83B7;&#x5F97;session&#x5BF9;&#x8C61;">&#x968F;&#x65F6;&#x83B7;&#x5F97;Session&#x5BF9;&#x8C61;</h2>
<p>&#x5728;VS&#x7684;&#x8BBE;&#x8BA1;&#x7406;&#x5FF5;&#x4E2D;&#xFF0C;Processor&#x5373;&#x5305;&#x62EC;download&#x7684;&#x6B65;&#x9AA4;&#xFF0C;&#x4F46;&#x662F;&#x4E3A;&#x4E86;&#x517C;&#x5BB9;&#x67D0;&#x4E9B;&#x5176;&#x4ED6;&#x722C;&#x866B;&#x6846;&#x67B6;&#x7528;&#x6CD5;&#xFF0C;VS&#x7684;&#x6269;&#x5C55;&#x4E2D;&#xFF0C;&#x5B58;&#x5728;&#x5C06;&#x4E0B;&#x8F7D;&#x548C;&#x89E3;&#x6790;&#x5206;&#x5F00;&#x7684;&#x5C01;&#x88C5;&#x3002;&#x5E38;&#x89C1;&#x7684;&#x5C31;&#x662F;AutoParseSeedProcessor&#xFF0C;&#x6216;&#x8005;&#x8BF4;VS&#x6709;&#x8BA1;&#x5212;&#x6865;&#x63A5;webmagic&#x3002;&#x8FD9;&#x4E2A;&#x65F6;&#x5019;&#x5982;&#x679C;&#x8FD8;&#x60F3;&#x518D;&#x89E3;&#x6790;&#x7684;&#x65F6;&#x5019;&#x8BBF;&#x95EE;&#x7F51;&#x7EDC;&#x5E94;&#x8BE5;&#x600E;&#x4E48;&#x529E;&#xFF1F;&#x56E0;&#x4E3A;&#x63A5;&#x53E3;&#x5C31;&#x6CA1;&#x6709;&#x4F20;&#x9012;downloader&#x5BF9;&#x8C61;&#x554A;&#x3002;</p>
<p>&#x6211;&#x5BF9;&#x4F60;&#x4EEC;&#x5F88;&#x597D;&#xFF0C;&#x4E13;&#x95E8;&#x8003;&#x8651;&#x4E86;&#x8FD9;&#x70B9;&#x513F;&#xFF0C;&#x4F60;&#x53EA;&#x9700;&#x8981;&#x8C03;&#x7528;&#x65B9;<code>com.virjar.vscrawler.core.util.VSCrawlerCommonUtil\#crawlerSessionInThread</code> &#x5C31;&#x53EF;&#x4EE5;&#x62FF;&#x5230;session&#x5BF9;&#x8C61;&#xFF0C;&#x4ED6;&#x662F;&#x4E00;&#x4E2A;&#x9759;&#x6001;&#x65B9;&#x6CD5;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x505A;&#x4EC0;&#x4E48;&#x521D;&#x59CB;&#x5316;&#x52A8;&#x4F5C;&#xFF0C;&#x800C;&#x4E14;&#x5C31;&#x662F;&#x7ED1;&#x5B9A;&#x518D;&#x5BF9;&#x5E94;&#x7684;processor&#x4E0A;&#x9762;&#x7684;&#x3002;&#x672C;&#x529F;&#x80FD;&#x57FA;&#x4E8E;ThreadLocal&#x5B9E;&#x73B0;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x611F;&#x5174;&#x8DA3;&#xFF0C;&#x8BF7;&#x767E;&#x5EA6;ThreadLocal</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="22-pipline.html" class="navigation navigation-prev " aria-label="Previous page: 2.2 Pipline">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../3pa-chong-kong-zhi.html" class="navigation navigation-next " aria-label="Next page: 3.爬虫控制">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"2.3 SessionPool","level":"1.3.3","depth":2,"next":{"title":"3.爬虫控制","level":"1.4","depth":1,"path":"3pa-chong-kong-zhi.md","ref":"3pa-chong-kong-zhi.md","articles":[]},"previous":{"title":"2.2 Pipline","level":"1.3.2","depth":2,"path":"2ji-ben-zu-jian/22-pipline.md","ref":"2ji-ben-zu-jian/22-pipline.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"2ji-ben-zu-jian/23-sessionpool.md","mtime":"2017-06-24T11:51:44.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-06-25T14:04:12.299Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

